package animation;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Point;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.view.View;

public class MyDragShadowBuilder extends View.DragShadowBuilder {
	private static Drawable shadow;

	public MyDragShadowBuilder(View v) {
		super(v);
		shadow = new ColorDrawable(Color.LTGRAY);
	}
	
	@Override
	public void onProvideShadowMetrics(Point size, Point touch) {
		int v_width, v_height;

		v_width = getView().getWidth() / 2;
		v_height = getView().getHeight() / 2;

		shadow.setBounds(0, 0, v_width, v_height);
		size.set(v_width, v_height);
		touch.set(v_width / 2, v_height / 2);

	}

	@Override
	public void onDrawShadow(Canvas canvas) {
		shadow.draw(canvas);
	}
}
